package com.yunfei.api.v2.service;
import com.yunfei.api.v2.param.heTongLuRu.ContractUpdateParam;
import com.yunfei.bo.result.ResultModel;
import com.yunfei.enums.ResultStatus;
import com.yunfei.mapper.crm.ContractUpdateMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @Description: 合同编辑
* @Author: zhengyunfei
* @Date: 2019/8/27
* @time:10:52
*/
@Service
public class ContractUpdateService {
    @Autowired
    private ContractUpdateMapper contractUpdateMapper;
    //合同编辑
    public ResultModel contractUpdate(ContractUpdateParam param){
        ResultModel resultModel=new ResultModel();
        try{
            contractUpdateMapper.update1(param);
            contractUpdateMapper.update2(param);
            contractUpdateMapper.update3(param);
            resultModel.setData(ResultStatus.OPER_SUCCESS.getMessage());
            resultModel.setCode(ResultStatus.SUCCESS.getCode());
            resultModel.setMessage(ResultStatus.SUCCESS.getMessage());
        }catch (Exception e){
            resultModel.setCode(ResultStatus.ERROR.getCode());
            resultModel.setMessage(ResultStatus.ERROR.getMessage());
            e.printStackTrace();
        }
        return resultModel;
    }


}
